<?php
  $userid = $_GET["userid"];
  $conn = mysql_connect("localhost","root","root");
  mysql_select_db("database_phone");
  $result = mysql_query("select * from user2phone sp left join phone on sp.phoneid = phone.id left join pcolor on sp.pcolorid = pcolor.id left join pstorage on sp.pstorageid = pstorage.id left join pprice on sp.ppriceid = pprice.id left join pimg on sp.pimgid = pimg.id where userid ='$userid'",$conn);
  if(mysql_num_rows($result) > 0){
    while ($row = mysql_fetch_assoc($result)) {
      echo $row["pname"];
      echo ";";
      echo $row["ptype"];
      echo ";";
      echo $row["pcolor"];
      echo ";";
      echo $row["pstorage"];
      echo ";";
      echo $row["pprice"];
      echo ";";
      echo $row["pimg"];
      echo ";";
      echo $row["pnum"];
      echo "&";
    }
  }else{
    echo "";
  }

  mysql_close($conn);

?>
